
#ifndef  BREAKPOINTSTATESST_H
#define  BREAKPOINTSTATESST_H

#include "IBreakPointState.h"

class BreakPointStateSST : public IBreakPointState {
public:
    BreakPointStateSST();
    virtual ~BreakPointStateSST();

    bool isEnd() const override;
    bool isInited() const override;
    bool isConnected() const override;
    bool isLogined() const override;
    bool isDisconnected() const override;

    int toEnd() override;
    int toInited() override;
    int toConnected() override;
    int toLogined() override;
    int toDisconnected() override;

    std::ostream &  log(std::ostream & out) override;

private:
    int status;
private:
    // State Switch Table   
    //      [cur][next] == 1 => switch Ok;  
    //      [cur][next] == 0 -> Failed
    //            END -> INITED -> CONNECTED -> LOGINED -> DISCONNECTED
    //    
    //END          0       1           0           0           0
    //
    //INITED       1       0           1           0           0
    //
    //CONNECTED    1       0           0           1           1
    //
    //LOGINED      1       0           0           0           1
    //
    //DISCONNECTED 1       0           0           0           0
    typedef int SSTType[MAX_STATE][MAX_STATE];
    SSTType * sst;
    int toNext(int next);
};

#endif   /* BREAKPOINTSTATESST_H */
